import * as ActionTypes from './type'

export default {
  // 同步用户信息
  [ActionTypes.USER_LOGIN]: (state, data) => {
    if (data.callback) {
      data.callback()
    }
  },
  [ActionTypes.USER_LOGOUT]: state => { },
  [ActionTypes.USER_INFO]: (state, data) => {
    state.user = data.response
    state.user.isLogin = true
    if (typeof data.callback === 'function') {
      data.callback()
    }
  }
}
